﻿<%@ Page Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<ASPItalia.ModelVirtualCasting.ObjectModel.MultimediaDTO>" %>
<%@ Import Namespace="ASPItalia.ModelVirtualCasting.Web.Utils" %>

<asp:Content ID="Content3" ContentPlaceHolderID="Head" runat="server">
<%if (this.Model.Multimedia != null) {%>

	<%-- use google --%>
<%--	<script type="text/javascript" src="/Scripts/simple.video.js">
	</script>--%>

    
   <link rel="stylesheet" href="/Scripts/mediaelementplayer.min.css" type="text/css" />
	<script type="text/javascript" src="/Scripts/mediaelement-and-player.min.js">
	</script>
	<script type="text/javascript">
		$(function () { $("#video").mediaelementplayer({ enableAutosize: true }); });
	</script>

<%} %>
</asp:Content>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
	<%: (this.Model.Multimedia != null)?this.Model.Nickname: "Elemento non disponibile"%>
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">

	<%if (this.Model.Multimedia != null) {%>
		<article>
			<header><h1><%: this.Model.Nickname %></h1></header>
			
			<div class="centered" style="padding-top:10px;">

				<%if (this.Model.Multimedia is ASPItalia.ModelVirtualCasting.ObjectModel.Video) {%>
						<video id="video"
							width="450"
							src="<%= this.Model.Multimedia.FileName.ToVideoAbsoluteUrl() %>"
							poster="<%= this.Model.Multimedia.FileName.ToThumbnailAbsoluteUrl()+".png" %>">

								<!-- contenuto alternativo, se manca il supporto al tag video -->
								<img src="<%= this.Model.Multimedia.FileName.ToThumbnailAbsoluteUrl()+".png"%>" />

								<strong><a href="<%= this.Model.Multimedia.FileName.ToVideoAbsoluteUrl() %>">Scarica il video</a></strong>

						</video>
						<div>
							<a href="javascript:void(0)" id="play"></a> <span id="time" />
						</div>
				<%} else {%>
					<img src="<%= this.Model.Multimedia.FileName.ToImageAbsoluteUrl()%>"
					style="max-width:500px;" />
				<%} %>

			</div>
		</article>

		<%-- altre img nella gallery --%>
		<%if (this.Model.Person.Multimedia != null) { %>
		<div id="imageContainer">
		<ul>
		<% foreach (var element in this.Model.Person.Multimedia)
		   { %>
			<li><%= Html.DisplayFor(m => element) %></li>
		<% } %>
		</ul>
		<%} %>
	</div>
	<%}else{ %>
		<p>Impossibile visualizzare l'elemento richiesto.</p>
	<%} %>
</asp:Content>